{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 202,
   "id": "deee1880-3614-4cb8-83f8-6f6bf72908d2",
   "metadata": {},
   "outputs": [],
   "source": [
    "from pandas.io.parsers.readers import read_table\n",
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 212,
   "id": "0fcecfed-2c68-4bb0-972d-34f0d909b8a5",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Year</th>\n",
       "      <th>Crop</th>\n",
       "      <th>Latitude</th>\n",
       "      <th>Longitude</th>\n",
       "      <th>Polder</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2016</td>\n",
       "      <td>HYV Rice</td>\n",
       "      <td>22⁰43'53.5''N</td>\n",
       "      <td>89⁰30'27.3''E</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2016</td>\n",
       "      <td>HYV Rice</td>\n",
       "      <td>22⁰43'54.3''N</td>\n",
       "      <td>89⁰30'05.9''E</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2016</td>\n",
       "      <td>HYV Rice</td>\n",
       "      <td>22⁰43'58.8''N</td>\n",
       "      <td>89⁰29'47.1''E</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2016</td>\n",
       "      <td>HYV Rice</td>\n",
       "      <td>22⁰44'01.3''N</td>\n",
       "      <td>89⁰29'20.1''E</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2016</td>\n",
       "      <td>HYV Rice</td>\n",
       "      <td>22⁰43'56.2''N</td>\n",
       "      <td>89⁰29'47.1''E</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>960</th>\n",
       "      <td>2021</td>\n",
       "      <td>HYV Rice</td>\n",
       "      <td>22⁰40'30.6''N</td>\n",
       "      <td>89⁰32'56.2''E</td>\n",
       "      <td>34/2P</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>961</th>\n",
       "      <td>2021</td>\n",
       "      <td>HYV Rice</td>\n",
       "      <td>22⁰40'43.3''N</td>\n",
       "      <td>89⁰32'46.3''E</td>\n",
       "      <td>34/2P</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>962</th>\n",
       "      <td>2021</td>\n",
       "      <td>HYV Rice</td>\n",
       "      <td>22⁰40'41.0''N</td>\n",
       "      <td>89⁰32'41.2''E</td>\n",
       "      <td>34/2P</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>963</th>\n",
       "      <td>2021</td>\n",
       "      <td>HYV Rice</td>\n",
       "      <td>22⁰44'06.6''N</td>\n",
       "      <td>89⁰25'48.4''E</td>\n",
       "      <td>29</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>964</th>\n",
       "      <td>2021</td>\n",
       "      <td>HYV Rice</td>\n",
       "      <td>22⁰40'48.9''N</td>\n",
       "      <td>89⁰32'35.0''E</td>\n",
       "      <td>34/2P</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>965 rows × 5 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     Year      Crop       Latitude      Longitude Polder\n",
       "0    2016  HYV Rice  22⁰43'53.5''N  89⁰30'27.3''E    NaN\n",
       "1    2016  HYV Rice  22⁰43'54.3''N  89⁰30'05.9''E    NaN\n",
       "2    2016  HYV Rice  22⁰43'58.8''N  89⁰29'47.1''E    NaN\n",
       "3    2016  HYV Rice  22⁰44'01.3''N  89⁰29'20.1''E    NaN\n",
       "4    2016  HYV Rice  22⁰43'56.2''N  89⁰29'47.1''E    NaN\n",
       "..    ...       ...            ...            ...    ...\n",
       "960  2021  HYV Rice  22⁰40'30.6''N  89⁰32'56.2''E  34/2P\n",
       "961  2021  HYV Rice  22⁰40'43.3''N  89⁰32'46.3''E  34/2P\n",
       "962  2021  HYV Rice  22⁰40'41.0''N  89⁰32'41.2''E  34/2P\n",
       "963  2021  HYV Rice  22⁰44'06.6''N  89⁰25'48.4''E     29\n",
       "964  2021  HYV Rice  22⁰40'48.9''N  89⁰32'35.0''E  34/2P\n",
       "\n",
       "[965 rows x 5 columns]"
      ]
     },
     "execution_count": 212,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data = pd.read_table(r'D:\\crop_season_stats\\data_transfer\\transfer_data.txt')\n",
    "data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 213,
   "id": "955d8ccf-4c28-4bbf-bae8-441e3183de5c",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\tedesco\\Anaconda3\\envs\\tedesco\\lib\\site-packages\\dask\\dataframe\\core.py:6762: FutureWarning: Meta is not valid, `map_partitions` and `map_overlap` expects output to be a pandas object. Try passing a pandas object as meta or a dict or tuple representing the (name, dtype) of the columns. In the future the meta you passed will not work.\n",
      "  warnings.warn(\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|                                                                                            | 0/8 [00:00<…"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Latitude and Longitude Cleaning Report:\n",
      "\t965 values unable to be parsed (100.0%), set to NaN\n",
      "Result contains 0 (0.0%) values in the correct format and 965 null values (100.0%)\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Latitude</th>\n",
       "      <th>Latitude_clean</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>22⁰43'53.5''N</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>22⁰43'54.3''N</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>22⁰43'58.8''N</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>22⁰44'01.3''N</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>22⁰43'56.2''N</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>960</th>\n",
       "      <td>22⁰40'30.6''N</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>961</th>\n",
       "      <td>22⁰40'43.3''N</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>962</th>\n",
       "      <td>22⁰40'41.0''N</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>963</th>\n",
       "      <td>22⁰44'06.6''N</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>964</th>\n",
       "      <td>22⁰40'48.9''N</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>965 rows × 2 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "          Latitude  Latitude_clean\n",
       "0    22⁰43'53.5''N             NaN\n",
       "1    22⁰43'54.3''N             NaN\n",
       "2    22⁰43'58.8''N             NaN\n",
       "3    22⁰44'01.3''N             NaN\n",
       "4    22⁰43'56.2''N             NaN\n",
       "..             ...             ...\n",
       "960  22⁰40'30.6''N             NaN\n",
       "961  22⁰40'43.3''N             NaN\n",
       "962  22⁰40'41.0''N             NaN\n",
       "963  22⁰44'06.6''N             NaN\n",
       "964  22⁰40'48.9''N             NaN\n",
       "\n",
       "[965 rows x 2 columns]"
      ]
     },
     "execution_count": 213,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from dataprep.clean import clean_lat_long\n",
    "df = pd.DataFrame({\"Latitude\": data['Latitude']})\n",
    "\n",
    "df2 = clean_lat_long(df, lat_col=\"Latitude\")\n",
    "df2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 198,
   "id": "52232e91-be6e-4ece-85ea-8520a5a12200",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\tedesco\\Anaconda3\\envs\\tedesco\\lib\\site-packages\\dask\\dataframe\\core.py:6762: FutureWarning: Meta is not valid, `map_partitions` and `map_overlap` expects output to be a pandas object. Try passing a pandas object as meta or a dict or tuple representing the (name, dtype) of the columns. In the future the meta you passed will not work.\n",
      "  warnings.warn(\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "  0%|                                                                                            | 0/8 [00:00<…"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Latitude and Longitude Cleaning Report:\n",
      "\t2 values cleaned (0.21%)\n",
      "\t963 values unable to be parsed (99.79%), set to NaN\n",
      "Result contains 2 (0.21%) values in the correct format and 963 null values (99.79%)\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Longitude</th>\n",
       "      <th>Longitude_clean</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>89⁰30′27.3″E</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>89⁰30′05.9″E</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>89⁰29′47.1″E</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>89⁰29′20.1″E</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>89⁰29′47.1″E</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>960</th>\n",
       "      <td>89⁰32′56.2″E</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>961</th>\n",
       "      <td>89⁰32′46.3″E</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>962</th>\n",
       "      <td>89⁰32′41.2″E</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>963</th>\n",
       "      <td>89⁰25′48.4″E</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>964</th>\n",
       "      <td>89⁰32′35.0″E</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>965 rows × 2 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "        Longitude  Longitude_clean\n",
       "0    89⁰30′27.3″E              NaN\n",
       "1    89⁰30′05.9″E              NaN\n",
       "2    89⁰29′47.1″E              NaN\n",
       "3    89⁰29′20.1″E              NaN\n",
       "4    89⁰29′47.1″E              NaN\n",
       "..            ...              ...\n",
       "960  89⁰32′56.2″E              NaN\n",
       "961  89⁰32′46.3″E              NaN\n",
       "962  89⁰32′41.2″E              NaN\n",
       "963  89⁰25′48.4″E              NaN\n",
       "964  89⁰32′35.0″E              NaN\n",
       "\n",
       "[965 rows x 2 columns]"
      ]
     },
     "execution_count": 198,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from dataprep.clean import clean_lat_long\n",
    "df = pd.DataFrame({\"Longitude\": data['Longitude']})\n",
    "\n",
    "df3 = clean_lat_long(df, long_col=\"Longitude\")\n",
    "df3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 205,
   "id": "e1066a0b-ff0f-44fb-8775-c75d256dcfa5",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Longitude</th>\n",
       "      <th>Latitude</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>960</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>961</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>962</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>963</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>964</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>965 rows × 2 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     Longitude  Latitude\n",
       "0          NaN       NaN\n",
       "1          NaN       NaN\n",
       "2          NaN       NaN\n",
       "3          NaN       NaN\n",
       "4          NaN       NaN\n",
       "..         ...       ...\n",
       "960        NaN       NaN\n",
       "961        NaN       NaN\n",
       "962        NaN       NaN\n",
       "963        NaN       NaN\n",
       "964        NaN       NaN\n",
       "\n",
       "[965 rows x 2 columns]"
      ]
     },
     "execution_count": 205,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "final = pd.DataFrame({\"Longitude\": df3['Longitude_clean'], \"Latitude\": df2['Latitude_clean']})\n",
    "final"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 206,
   "id": "fb3b25d4-cef7-4ad5-9ef4-96ac707291f9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Year</th>\n",
       "      <th>Crop</th>\n",
       "      <th>Latitude</th>\n",
       "      <th>Longitude</th>\n",
       "      <th>Polder</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2016</td>\n",
       "      <td>HYV Rice</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2016</td>\n",
       "      <td>HYV Rice</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2016</td>\n",
       "      <td>HYV Rice</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2016</td>\n",
       "      <td>HYV Rice</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2016</td>\n",
       "      <td>HYV Rice</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>960</th>\n",
       "      <td>2021</td>\n",
       "      <td>HYV Rice</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>34/2P</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>961</th>\n",
       "      <td>2021</td>\n",
       "      <td>HYV Rice</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>34/2P</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>962</th>\n",
       "      <td>2021</td>\n",
       "      <td>HYV Rice</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>34/2P</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>963</th>\n",
       "      <td>2021</td>\n",
       "      <td>HYV Rice</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>29</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>964</th>\n",
       "      <td>2021</td>\n",
       "      <td>HYV Rice</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>34/2P</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>965 rows × 5 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     Year      Crop  Latitude  Longitude Polder\n",
       "0    2016  HYV Rice       NaN        NaN    NaN\n",
       "1    2016  HYV Rice       NaN        NaN    NaN\n",
       "2    2016  HYV Rice       NaN        NaN    NaN\n",
       "3    2016  HYV Rice       NaN        NaN    NaN\n",
       "4    2016  HYV Rice       NaN        NaN    NaN\n",
       "..    ...       ...       ...        ...    ...\n",
       "960  2021  HYV Rice       NaN        NaN  34/2P\n",
       "961  2021  HYV Rice       NaN        NaN  34/2P\n",
       "962  2021  HYV Rice       NaN        NaN  34/2P\n",
       "963  2021  HYV Rice       NaN        NaN     29\n",
       "964  2021  HYV Rice       NaN        NaN  34/2P\n",
       "\n",
       "[965 rows x 5 columns]"
      ]
     },
     "execution_count": 206,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data['Longitude'] = final['Longitude']\n",
    "data['Latitude'] = final['Latitude']\n",
    "data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 201,
   "id": "b64cedb1-342a-4661-ba38-01c1d6369ee5",
   "metadata": {},
   "outputs": [],
   "source": [
    "data.to_excel(r'D:\\crop_season_stats\\data_transfer\\coords.xlsx', index = None, header=True) #Don't forget to add '.xlsx' at the end of the path"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "0970af0d-aef2-417b-9d2f-abc8f721dbc2",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.16"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
